package cn.zn.modules.pz.enums;

import lombok.Getter;

// 流程类型
@Getter
public enum ProcessTypeEnum {
    /**
     * 经费支出
     */
    SPENDING("spending", "经费支出", "spending", "JFZC", "经费支出审批表"),
    /**
     * 费用报销
     */
    EXPENSE("expense", "费用报销", "expense", "FYBX", "财务报销单据"),
    /**
     * 费用报销
     */
    REPAY("repay", "费用报销-还款", "repay", "BXHK", "财务报销单据"),
    /**
     * 财务预约
     */
    APPOINT("appoint", "财务预约", "appoint", "CWYY", "财务办理");

    /**
     * 部署KEY
     */
    private String deployKey;
    /**
     * 部署名称
     */
    private String deployName;
    /**
     * 流程KEY
     */
    private String processKey;
    /**
     * 前缀
     */
    private String prefix;
    /**
     * 待办中的标题
     */
    private String todoTitle;

    private ProcessTypeEnum(String deployKey, String deployName, String processKey, String prefix, String todoTitle) {
        this.deployKey = deployKey;
        this.deployName = deployName;
        this.processKey = processKey;
        this.prefix = prefix;
        this.todoTitle = todoTitle;
    }

    public static ProcessTypeEnum findByDeployKey(String key) {
        for (ProcessTypeEnum e : values()) {
            if (e.getDeployKey().equals(key)) {
                return e;
            }
        }
        return null;
    }
}
